﻿namespace _RobotInspection.DTO
{
    /// <summary>
    /// 设备分页查询数据结构
    /// </summary>
    public class EquipmentPagedQueryDto
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public EquipmentPagedQueryDto()
        {

        }

        /// <summary>
        /// 公司名称（可模糊查询）
        /// </summary>
        public string? CompanyName { get; set; }

        /// <summary>
        /// 机组名称（可模糊查询）
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        public long? UserId { get; set; }

        /// <summary>
        /// 设备名称（可模糊查询）
        /// </summary>
        public string? EquipmentName { get; set; }

        /// <summary>
        /// 分页页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize { get; set; }
    }

    /// <summary>
    /// 创建设备数据结构
    /// </summary>
    public class EquipmentInsertDto
    {
        public EquipmentInsertDto()
        {

        }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string? EquipmentName { set; get; }

        /// <summary>
        /// 负责人id
        /// </summary>
        public long? UserId { get; set; } // 可以没有负责人

        /// <summary>
        /// 公司名称
        /// </summary>
        public string? CompanyName { set; get; }

        /// <summary>
        /// 机组名称
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 设备编码
        /// </summary>
        public string? EquipmentCode { get; set; }

        /// <summary>
        /// 宝武机器人编号
        /// </summary>
        public string? BaoRobotNumber { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public string? EquipmentType { get; set; }

        /// <summary>
        /// 设备位置（产线？）
        /// </summary>
        public string? Location { get; set; }

        /// <summary>
        /// 制造商
        /// </summary>
        public string? Manufacturer { get; set; }

        /// <summary>
        /// 型号
        /// </summary>
        public string? Model { get; set; }

        /// <summary>
        /// 设备状态 1-正常，0-停用
        /// </summary>
        public byte? Status { get; set; }

        /// <summary>
        /// 设备描述
        /// </summary>
        public string? DeviceDescrption { get; set; }
    }

    /// <summary>
    /// 修改设备数据接口
    /// </summary>
    public class EquipmentUpdateDto
    {
        //构造函数
        public EquipmentUpdateDto()
        {

        }

        /// <summary>
        /// 设备Id
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string? EquipmentName { get; set; }

        /// <summary>
        /// 负责人id
        /// </summary>
        public long? UserId { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        public string? CompanyName { set; get; }

        /// <summary>
        /// 机组名称
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 设备编码
        /// </summary>
        public string? EquipmentCode { get; set; }

        /// <summary>
        /// 宝武机器人编号
        /// </summary>
        public string? BaoRobotNumber { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public string? EquipmentType { get; set; }

        /// <summary>
        /// 设备位置（产线？）
        /// </summary>
        public string? Location { get; set; }

        /// <summary>
        /// 制造商
        /// </summary>
        public string? Manufacturer { get; set; }

        /// <summary>
        /// 型号
        /// </summary>
        public string? Model { get; set; }

        /// <summary>
        /// 设备状态 1-正常，0-停用
        /// </summary>
        public byte? Status { get; set; }

        /// <summary>
        /// 设备描述
        /// </summary>
        public string? DeviceDescrption { get; set; }
    }

    /// <summary>
    /// 设备查询结果数据结构
    /// </summary>
    public class EquipmentResultDto
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public EquipmentResultDto()
        {

        }

        /// <summary>
        /// 设备Id
        /// </summary>
        public long EquipmentId { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string EquipmentName { set; get; }

        /// <summary>
        /// 负责人（真名）
        /// </summary>
        public string? RealName { set; get; }

        /// <summary>
        /// 公司名称
        /// </summary>
        public string? CompanyName { set; get; }

        /// <summary>
        /// 机组名称
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 设备编码
        /// </summary>
        public string EquipmentCode { get; set; } // 不可为空，不会重复

        /// <summary>
        /// 宝武机器人编号
        /// </summary>
        public string? BaoRobotNumber { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public string? EquipmentType { get; set; }

        /// <summary>
        /// 设备位置（产线？）
        /// </summary>
        public string? Location { get; set; }

        /// <summary>
        /// 制造商
        /// </summary>
        public string? Manufacturer { get; set; }

        /// <summary>
        /// 型号
        /// </summary>
        public string? Model { get; set; }

        /// <summary>
        /// 设备状态 1-正常，0-停用
        /// </summary>
        public byte? Status { get; set; }

        /// <summary>
        /// 设备描述
        /// </summary>
        public string? DeviceDescrption { get; set; }
    }

    /// <summary>
    /// 设备分页结果数据结构
    /// </summary>
    public class EquipmentPagedResultDto
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public EquipmentPagedResultDto()
        {

        }
        /// <summary>
        /// 返回设备内容
        /// </summary>
        public List<EquipmentResultDto> EquipmentResultList { get; set; } = [];

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 是否有上一页
        /// </summary>
        public bool HasPreviousPage { get; set; }

        /// <summary>
        /// 是否有下一页
        /// </summary>
        public bool HasNextPage { get; set; }
    }
}
